﻿Public Class label : Inherits element

    ReadOnly Property td As td
        Get
            Return Parent
        End Get
    End Property

    Public Overrides Sub Draw(ByVal g As System.Drawing.Graphics, ByVal P As System.Drawing.Point)
        Parent.DrawText(g, Inside, Font, New Rectangle(P.X, P.Y, td.SpanWidth - 2 * td.Column.table.CellPadding, 1000), Color.Black, Parent.Style.align)
    End Sub

    Public Overrides ReadOnly Property MinWidth As Integer
        Get
            Return Parent.MeasureText(Inside, Font, New Size(1, 1000)).Width
        End Get
    End Property
    Public Overrides ReadOnly Property MaxWidth As Integer
        Get
            Return Parent.MeasureText(Inside, Font, New Size(10000, 1000)).Width
        End Get
    End Property

    Public Overrides ReadOnly Property Height As Integer
        Get
            Return Parent.MeasureText(Inside, Font, New Size(td.SpanWidth - 2 * td.Column.table.CellPadding, 1000)).Height
        End Get
    End Property

    Public Overrides ReadOnly Property Width As Integer
        Get
            Return td.SpanWidth - 2 * td.Column.table.CellPadding
        End Get
    End Property

End Class